package day03;
//运算符的演示
public class OperDemo {
    public static void main(String[] args) {
        int num = 0;
        int flag = num>0?1:-1;
        System.out.println(flag);

        int a=8,b=5;
        int max = a>b?a:b;
        System.out.println(max);


        /*
        int age = 22;
        System.out.println("age=");
        System.out.println(age);
        System.out.println("age="+age);
        System.out.println("我今年"+age+"岁了!");

        String name = "MCFan";
        System.out.println("大家好，我叫"+name);
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了!");

        System.out.println(10+20+""+30); //3030
        System.out.println(10+20+30+""); //60
        System.out.println(""+10+20+30); //102030
        */

        /*
        int a = 5;
        a += 10;
        System.out.println(a); //15
        a *= 2;
        System.out.println(a); //30
        a /= 6;
        System.out.println(a); //5

        //小面试题
        short s = 5;
        //s = s+10; //编译错误，需要强转，改为：s = (short)(s+10)
        s += 10; //相当于s = (short)(s+10)
        System.out.println(s);
        */

        /*
        int a=5,b=10,c=5;
        System.out.println(b>=a || b<c);
        System.out.println(a==b || b<a);
        int score = 90;
        System.out.println(score<0 || score>100);

        boolean b2 = !(a<b);
        System.out.println(b2);
        System.out.println(!(a>b));
         */

        /*
        int age = 99;
        System.out.println(age>=18 && age<=50);
        int score = 86;
        System.out.println(score>=0 && score<=100);
         */

        /*
        int a=5,b=5;
        a++;
        ++b;
        System.out.println(a);
        System.out.println(b);

        a=5;
        b=5;
        int c = a++;
        int d = ++b;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);

        a = 5;
        b = 10;
        c = 5;
        boolean b1 = a>b;
        System.out.println(b1);
        System.out.println(c<b);
        System.out.println(a>=c);
        System.out.println(a<=b);
        System.out.println(a==c);
        System.out.println(a!=c);

        System.out.println(a%2==0);
        System.out.println(a+c>b);
        System.out.println(a++>5);
        System.out.println(a++>5);
         */
    }
}
